import http from '../util/request.js'

export default {
    add:(obj)=>{
        return http({
            url:'/goods/add',
            method:'post',
            data:obj,
            headers: {
                'Content-Type': 'application/json'
            }
        });
    },

    update:(obj)=>{
        return http({
            url:'/goods/update',
            method:'put',
            data:obj,
            headers: {
                'Content-Type': 'application/json'
            }
        })
    },

    delete:(id)=>{
        return http({
            url:'/goods/delete/' + id, // 添加正确的斜杠
            method:'delete'
        })
    },

    page:(obj)=>{
        return http({
            url:'/goods/page',
            method:'get',
            params:obj
        })
    }
}